//
//  SecondVC.swift
//  DaiLi
//
//  Created by yuanjiang on 2017/12/12.
//  Copyright © 2017年 yuanjiang. All rights reserved.
//

import UIKit

protocol PassValueDelegate: NSObjectProtocol {
    func doSomeThing(param: String, sss: [String], mmm: [String : Any])
}


class SecondVC: UIViewController {

    weak var delegate: PassValueDelegate?
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        self.view.backgroundColor = .white
        
        let button = UIButton(frame: CGRect(x: 100, y: 100, width: 100, height: 100))
        button.backgroundColor = .red
        button.tag = 100
        button.addTarget(self, action: #selector(dddd(sender:describe:)), for: .touchUpInside)
        self.view.addSubview(button)
    }

    @objc func dddd(sender: UIButton, describe: String){
        delegate?.doSomeThing(param: "\(sender.tag)", sss: ["q","w","e","r"], mmm: ["q":"1"])
    }
    
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
